<!DOCTYPE html>
<html>
<head>
    @include("/template/inc/inc.html"){}
    <title></title>
    <script>
        $(function () {
            $.post('${ctxPath}/shiro/principal', function (result) {
                //console.info(result);
                var msg = '欢迎 [{login_name}] ';
                msg = msg.replace('{login_name}', result.login_name);
                $('#shiro_main_principal').html(msg);
            }, 'json');
        });
    </script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'north',title:'',split:true" style="height:40px;text-align: right;">
        <span id="shiro_main_principal"></span>
        <a href="${ctxPath}/shiro/logout" class="easyui-linkbutton">登出</a>
    </div>
    <div data-options="region:'west',title:'菜单',split:true,hideCollapsedContent:false" style="width:300px;">
        <ul id="shiro_main_menu" class="easyui-tree"
            data-options="url:'${ctxPath}/shiro/resource/menu',parentField:'pid'
                        ,onClick:function(node){
                            if(node && node.attributes && node.attributes.url){
                                if($('#shiro_main_tabs').tabs('exists',node.text)){
                                    $('#shiro_main_tabs').tabs('select',node.text);
                                }else{
                                    $('#shiro_main_tabs').tabs('add',{
                                        title:node.text,
                                        href:'${ctxPath}'+node.attributes.url,
                                        closable:true
                                    });
                                }
                            }
                        }"></ul>
    </div>
    <div data-options="region:'center',title:''">
        <div id="shiro_main_tabs" class="easyui-tabs"
             data-options="fit:true,border:false
                        ,onClose:function(title,index){
                        }">
            <div title="ReadMe">
                说明
            </div>
        </div>
    </div>
    <div data-options="region:'south',title:'',split:true" style="height:30px;text-align: center;">版权所有 孙宇</div>
</div>
</body>
</html>